package com.liner;

/**
 * 学生类
 */
public class Student {
    //成员变量：
    /**
     * 学生名字
     */
    String name;
    /**
     * 学生年龄
     */
    int age;
    /**
     * 班级名
     */
    String className;
    /**
     * 学号
     */
    String stuId;

    //构造方法
    public Student() {
        //this("空",0, "空");
    }

    public Student(String name, int age, String className, String stuId) {
        this.name = name;
        this.age = age;
        this.className = className;
        this.stuId = stuId;
    }

    public Student(String name, int age, String className) {
        this.name = name;
        this.age = age;
        this.className = className;
    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", className='" + className + '\'' +
                ", stuId='" + stuId + '\'' +
                '}';
    }


    public static void eat() {
        int num = 12;
        System.out.println("吃饭" + num);
    }


    //方法：
    void study() {
        System.out.println("学号为:" + stuId + "的学生:" + name + ",今年" + age + "岁了,在" + className + "学习");
    }

    void playWithAnother(String name) {
        System.out.println(this.name + "在和" + name + "玩");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }
}
